//
//  UIBarButtonItem+Extension.swift
//  KimboWeiBoSwift
//
//  Created by kimbo on 15/12/20.
//  Copyright © 2015年 kimbo. All rights reserved.
//

import UIKit

/// 自定义UIBarButtonItem
extension UIBarButtonItem {
    convenience init(imageName: String) {
        let button = UIButton()
        
        let highlightedImageName = imageName + "_highlighted"
        button.setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        button.setImage(UIImage(named: highlightedImageName), forState: UIControlState.Highlighted)
        
        button.sizeToFit()
        
        self.init(customView: button)
    }
}


